public class test99_RegularPolygon {
    private int n;   // Number of sides, default 3
    private double side; // Length of side, default 1
    private double x;   // x-coordinate of center, default 0
    private double y;   // y-coordinate of center, default 0

    // No-arg constructor with default values
    public test99_RegularPolygon() {
        this(3, 1.0); // Calls the two-arg constructor
    }

    // Constructor with specified n and side, center at (0, 0)
    public test99_RegularPolygon(int n, double side) {
        this(n, side, 0.0, 0.0); // Calls the four-arg constructor
    }

    // Constructor with specified n, side, x, and y
    public test99_RegularPolygon(int n, double side, double x, double y) {
        this.n = n;
        this.side = side;
        this.x = x;
        this.y = y;
    }

    // Accessor and mutator methods for n
    public int getN() {
        return n;
    }

    public void setN(int n) {
        this.n = n;
    }

    // Accessor and mutator methods for side
    public double getSide() {
        return side;
    }

    public void setSide(double side) {
        this.side = side;
    }

    // Accessor and mutator methods for x
    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    // Accessor and mutator methods for y
    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    // Calculate and return the perimeter
    public double getPerimeter() {
        return n * side;
    }

    // Calculate and return the area using the formula
    public double getArea() {
        return (n * side * side) / (4 * Math.tan(Math.PI / n));
    }
}